﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GraphCompiler.Core.SyntaxRepresentation
{
    public class ArrowNode : DiagramChildNode
    {
        public ArrowNode(string fromBoxName, string toBoxName)
        {
            FromName = fromBoxName;
            ToName = toBoxName;
        }

        public string FromName { get; set; }
        public string ToName { get; set; }

        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return false;
            }

            var other = obj as ArrowNode;

            return FromName == other.FromName &&
                ToName == other.ToName;
        }

        public override string ToString()
        {
            return FromName + " -> " + ToName;
        }

        public override int GetHashCode()
        {
            return ToString().GetHashCode();
        }
    }
}
